<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <title>babili-standalone example</title>
</head>
<body>
  Input:
  <textarea id="input" style="width: 100%" rows="10">
// Example ES2015 Code
class Mangler {
  constructor(program) {
    this.program = program;
  }
}
new Mangler();
</textarea>

  Transformed code using Babili <strong id="version"></strong>:
  <pre id="output">Loading...</pre>

  <script src="../babel.js"></script>
  <script src="../packages/babili-standalone/babili.js"></script>
  <script>
    console.log('Babel =', Babel);
    console.log('Babili =', Babili);
    var inputEl = document.getElementById('input');
    var outputEl = document.getElementById('output');

    function transform() {
      //try {
        outputEl.innerHTML = Babili.transform(inputEl.value).code;
      //} catch (ex) {
        //outputEl.innerHTML = 'ERROR: ' + ex.message;
      //}
    }

    inputEl.addEventListener('keyup', transform, false);
    transform();
  </script>
</body>
</html>
